﻿
namespace bookMaster.AssetSystem.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.Catalogo"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class CatalogoEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the IdCatalogo property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxIdCatalogo;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IdCatalogo property.
		/// </summary>
		protected System.Windows.Forms.Label uxIdCatalogoLabel;
		
		/// <summary>
		/// TextBox for the Isbn property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxIsbn;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Isbn property.
		/// </summary>
		protected System.Windows.Forms.Label uxIsbnLabel;
		
		/// <summary>
		/// TextBox for the NombreLibro property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxNombreLibro;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the NombreLibro property.
		/// </summary>
		protected System.Windows.Forms.Label uxNombreLibroLabel;
		
		/// <summary>
		/// ComboBox for the IdProveedor property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIdProveedor;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IdProveedor property.
		/// </summary>
		protected System.Windows.Forms.Label uxIdProveedorLabel;
		
		/// <summary>
		/// TextBox for the Estado property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxEstado;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Estado property.
		/// </summary>
		protected System.Windows.Forms.Label uxEstadoLabel;
		#endregion
		
		#region Main entity
		private Entities.Catalogo _Catalogo;
		/// <summary>
		/// Gets or sets the <see cref="Entities.Catalogo"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.Catalogo"/> instance.</value>
		public Entities.Catalogo Catalogo
		{
			get {return this._Catalogo;}
			set
			{
				this._Catalogo = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxIdCatalogo.DataBindings.Clear();
			this.uxIdCatalogo.DataBindings.Add("Text", this.uxBindingSource, "IdCatalogo", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIsbn.DataBindings.Clear();
			this.uxIsbn.DataBindings.Add("Text", this.uxBindingSource, "Isbn", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxNombreLibro.DataBindings.Clear();
			this.uxNombreLibro.DataBindings.Add("Text", this.uxBindingSource, "NombreLibro", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIdProveedor.DataBindings.Clear();
			this.uxIdProveedor.DataBindings.Add("SelectedValue", this.uxBindingSource, "IdProveedor", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxEstado.DataBindings.Clear();
			this.uxEstado.DataBindings.Add("Text", this.uxBindingSource, "Estado", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="CatalogoEditControlBase"/> class.
		/// </summary>
		public CatalogoEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_Catalogo != null) _Catalogo.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxIdCatalogo = new System.Windows.Forms.TextBox();
			uxIdCatalogoLabel = new System.Windows.Forms.Label();
			this.uxIsbn = new System.Windows.Forms.TextBox();
			uxIsbnLabel = new System.Windows.Forms.Label();
			this.uxNombreLibro = new System.Windows.Forms.TextBox();
			uxNombreLibroLabel = new System.Windows.Forms.Label();
			this.uxIdProveedor = new System.Windows.Forms.ComboBox();
			uxIdProveedorLabel = new System.Windows.Forms.Label();
			this.uxEstado = new System.Windows.Forms.TextBox();
			uxEstadoLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIdCatalogoLabel
			//
			this.uxIdCatalogoLabel.Name = "uxIdCatalogoLabel";
			this.uxIdCatalogoLabel.Text = "Id Catalogo:";
			this.uxIdCatalogoLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIdCatalogoLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIdCatalogoLabel);			
			//
			// uxIdCatalogo
			//
			this.uxIdCatalogo.Name = "uxIdCatalogo";
			this.uxIdCatalogo.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxIdCatalogo);
			this.uxIdCatalogo.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxIdCatalogo);
			//
			// uxIsbnLabel
			//
			this.uxIsbnLabel.Name = "uxIsbnLabel";
			this.uxIsbnLabel.Text = "Isbn:";
			this.uxIsbnLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxIsbnLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIsbnLabel);			
			//
			// uxIsbn
			//
			this.uxIsbn.Name = "uxIsbn";
			this.uxIsbn.Width = 250;
			this.uxIsbn.MaxLength = 20;
			//this.uxTableLayoutPanel.Controls.Add(this.uxIsbn);
			this.uxIsbn.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxIsbn);
			//
			// uxNombreLibroLabel
			//
			this.uxNombreLibroLabel.Name = "uxNombreLibroLabel";
			this.uxNombreLibroLabel.Text = "Nombre Libro:";
			this.uxNombreLibroLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxNombreLibroLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxNombreLibroLabel);			
			//
			// uxNombreLibro
			//
			this.uxNombreLibro.Name = "uxNombreLibro";
			this.uxNombreLibro.Width = 250;
			this.uxNombreLibro.MaxLength = 150;
			//this.uxTableLayoutPanel.Controls.Add(this.uxNombreLibro);
			this.uxNombreLibro.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxNombreLibro);
			//
			// uxIdProveedorLabel
			//
			this.uxIdProveedorLabel.Name = "uxIdProveedorLabel";
			this.uxIdProveedorLabel.Text = "Id Proveedor:";
			this.uxIdProveedorLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxIdProveedorLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIdProveedorLabel);			
			//
			// uxIdProveedor
			//
			this.uxIdProveedor.Name = "uxIdProveedor";
			//this.uxTableLayoutPanel.Controls.Add(this.uxIdProveedor);
			this.uxIdProveedor.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxIdProveedor);
			//
			// uxEstadoLabel
			//
			this.uxEstadoLabel.Name = "uxEstadoLabel";
			this.uxEstadoLabel.Text = "Estado:";
			this.uxEstadoLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxEstadoLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxEstadoLabel);			
			//
			// uxEstado
			//
			this.uxEstado.Name = "uxEstado";
			//this.uxTableLayoutPanel.Controls.Add(this.uxEstado);
			this.uxEstado.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxEstado);
			//
			// uxIdProveedor
			//				
			this.uxIdProveedor.DisplayMember = "NombreProveedor";	
			this.uxIdProveedor.ValueMember = "IdProveedor";	
			// 
			// CatalogoEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "CatalogoEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.Proveedores> _IdProveedorList;
		
		/// <summary>
		/// The ComboBox associated with the IdProveedor property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Proveedores> IdProveedorList
		{
			get {return _IdProveedorList;}
			set 
			{
				this._IdProveedorList = value;
				this.uxIdProveedor.DataSource = null;
				this.uxIdProveedor.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIdProveedorList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IdProveedor property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIdProveedorList
		{
			get { return _allowNewItemInIdProveedorList;}
			set
			{
				this._allowNewItemInIdProveedorList = value;
				this.uxIdProveedor.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
        #region Field visibility

        /// <summary>
        /// Indicates if the controls associated with the uxIdCatalogo property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxIdCatalogoVisible
        {
            get { return this.uxIdCatalogo.Visible; }
            set
            {
                this.uxIdCatalogoLabel.Visible = value;
                this.uxIdCatalogo.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxIdCatalogo property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxIdCatalogoEnabled
        {
            get { return this.uxIdCatalogo.Enabled; }
            set
            {
                this.uxIdCatalogo.Enabled = value;
            }
        }
        /// <summary>
        /// Indicates if the controls associated with the uxIsbn property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxIsbnVisible
        {
            get { return this.uxIsbn.Visible; }
            set
            {
                this.uxIsbnLabel.Visible = value;
                this.uxIsbn.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxIsbn property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxIsbnEnabled
        {
            get { return this.uxIsbn.Enabled; }
            set
            {
                this.uxIsbn.Enabled = value;
            }
        }
        /// <summary>
        /// Indicates if the controls associated with the uxNombreLibro property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxNombreLibroVisible
        {
            get { return this.uxNombreLibro.Visible; }
            set
            {
                this.uxNombreLibroLabel.Visible = value;
                this.uxNombreLibro.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxNombreLibro property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxNombreLibroEnabled
        {
            get { return this.uxNombreLibro.Enabled; }
            set
            {
                this.uxNombreLibro.Enabled = value;
            }
        }
        /// <summary>
        /// Indicates if the controls associated with the uxIdProveedor property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxIdProveedorVisible
        {
            get { return this.uxIdProveedor.Visible; }
            set
            {
                this.uxIdProveedorLabel.Visible = value;
                this.uxIdProveedor.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxIdProveedor property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxIdProveedorEnabled
        {
            get { return this.uxIdProveedor.Enabled; }
            set
            {
                this.uxIdProveedor.Enabled = value;
            }
        }
        /// <summary>
        /// Indicates if the controls associated with the uxEstado property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxEstadoVisible
        {
            get { return this.uxEstado.Visible; }
            set
            {
                this.uxEstadoLabel.Visible = value;
                this.uxEstado.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxEstado property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxEstadoEnabled
        {
            get { return this.uxEstado.Enabled; }
            set
            {
                this.uxEstado.Enabled = value;
            }
        }

        #endregion

		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
